package com.lai.qq.admin.biz.res;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class RebackInfoResult<T> extends BaseResult {
    /**
     *
     */
    private static final long serialVersionUID = 8678703469664752743L;

    /**
     * 返回的数据
     */
    private T data;

    public  RebackInfoResult success(){
        RebackInfoResult result =new RebackInfoResult();
        result.setCode(ResultEnums.SUCCESS.getCode());
        result.setMsg(ResultEnums.SUCCESS.getMsg());
        return result;
    }

    public  RebackInfoResult success(Object data){
        RebackInfoResult result =new RebackInfoResult();
        result.setCode(ResultEnums.SUCCESS.getCode());
        result.setMsg(ResultEnums.SUCCESS.getMsg());
        result.setData(data);
        return result;
    }

    public  RebackInfoResult failure(){
        RebackInfoResult result =new RebackInfoResult();
        result.setCode(ResultEnums.ERROR.getCode());
        result.setMsg(ResultEnums.ERROR.getMsg());
        return result;
    }

    public  RebackInfoResult failure(Object data){
        RebackInfoResult result =new RebackInfoResult();
        result.setCode(ResultEnums.ERROR.getCode());
        result.setMsg(ResultEnums.ERROR.getMsg());
        result.setData(data);
        return result;
    }

    public  RebackInfoResult systemError(){
        RebackInfoResult result =new RebackInfoResult();
        result.setCode(ResultEnums.SYSTEM_ERROR.getCode());
        result.setMsg(ResultEnums.SYSTEM_ERROR.getMsg());
        return result;
    }

    public  RebackInfoResult paramError(Object data){
        RebackInfoResult result =new RebackInfoResult();
        result.setCode(ResultEnums.PARAM_ERROR.getCode());
        result.setMsg(ResultEnums.PARAM_ERROR.getMsg());
        result.setData(data);
        return result;
    }

    public  RebackInfoResult bussinessError(Object data){
        RebackInfoResult result =new RebackInfoResult();
        result.setCode(ResultEnums.BUSSINESS_ERROR.getCode());
        result.setMsg(ResultEnums.BUSSINESS_ERROR.getMsg());
        result.setData(data);
        return result;
    }

}
